<include file="Common:header" />
<TYjs file='fix_table_title'/>
<style> 
.success{width:20%;float:left;}
.success img{width:100%}
</style> 
<div class="table_content">
    <form action="{:U(MODULE_NAME.'/'.CONTROLLER_NAME.'/delete_post')}" method="post" class="ajax_form">
        <table class="list_table">
            <tr>
                <th style="min-width:100px;">頭像</th>
                <th style="min-width:80px;">用戶名</th>
                <th width="130px">操作</th>
            </tr>
            <foreach name='list' item='vo'>
                <tr>
                	<td><img src="{$vo.weixin_avatar}"></td>
                    <td>
                    	{$vo.name}
                    </td>                    
                    <td>
                     <input type="button" class="change_shopowner_status status_enable" url="{:U(MODULE_NAME.'/Audit/change_staff_status',array('id'=>$vo['id'],'is_success'=>'1'))}"/>
               		<input type="button" class="change_shopowner_status status_disable" url="{:U(MODULE_NAME.'/Audit/change_staff_status',array('id'=>$vo['id'],'is_success'=>'0'))}"/>
                    </td>
                </tr>
            </foreach>
        </table>
    </form>
    <div class="page">{$page}</div>
</div>
<script type="text/javascript">
    $(function() {
    	$('.change_shopowner_status').click(function() {
            var jsUrl = $(this).attr('url');
            var $this = $(this);
            $this.attr('disabled', true);
            $this.tyAjax({
                isForm: false,
                type: 'get',
                url: jsUrl,
                callBack: function(data) {

                    icon = data.status > 0 ? 'succeed' : 'error';
                    art.dialog({
                        "icon": icon,
                        "title": '消息',
                        "id": "loadding",
                        "lock": true,
                        "fixed": true,
                        "drag": false
                    }).content(data.info).time(1.5);
                    
                    if(data.url != ''){
                    	var interval = setInterval(function() {
                        	clearInterval(interval);
                            window.location.href = data.url;
                        }, jumpTime * 1000);
                    }

                    $this.attr('disabled', false);
                    setTimeout("window.location.reload()",2000)
        
                }
            });
        });
    });
</script>
<include file="Common:footer" />
